<?php
/**
 * @copyright since 23:20 28/3/2020
 * @author <mc@dancis.info>
 */
$main = function () {
    echo '<pre>';

    echo (array_key_exists('s', $_POST) && $_POST['s'])
        ? 'The following keywords had been entered: ' . implode(', ', explode(' ', $_POST['s'])) . '.'
        : 'Nothing entered.',
    PHP_EOL;

    (function () {
        echo (array_key_exists('s', $_POST) && $_POST['s'])
            ? 'The following keywords had been entered: ' . implode(' | ', explode(' ', $_POST['s'])) . '.'
            : 'Nothing entered.',
        PHP_EOL;
    })();

    echo '</pre>';
};

$main();
